<template>
	<view class="pageBg">
		<goodlist :listData="list" type="2"></goodlist>
	</view>
</template>

<script>
	import { pageScroll } from '@/utils/mixins.js';
	import goodlist from '@/components/index/goodlist/goodlist.vue';
	export default {
		mixins: [pageScroll],
		components: {
			goodlist,
		},
		data() {
			return {
				time_type: '2',
			};
		},
		onLoad({ time_type }) {
			this.time_type = time_type;
			uni.setNavigationBarTitle({
				title: time_type == 1 ? '往期展会' : time_type == 2 ? '举办中的展会' : '近期举办的展会',
			});
			this.init();
		},
		methods: {
			async init() {
				const { data } = await this.$api.goodslists({ ...this.page, time_type: this.time_type });
				this.list = [...this.list, ...data.lists];

				this.page.count = data.count;
			},
		},
	};
</script>

<style lang="scss" scoped>
	.pageBg {
	}
</style>
